package com.shop.dao;

import com.shop.bean.Orders;
import com.shop.bean.Order_address;
import com.shop.bean.Order_details;
import com.shop.bean.Product;
import com.shop.util.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface OrdersDao {

    int addOrder(@Param("order") Orders order);

    int addOrderInfo(@Param("orderinfos") List<Order_details> orderinfos);

    int addOrderAddress(@Param("orderaddress") Order_address orderaddress);
    Orders getOrderByID(@Param("id")Integer id);

    //返回用户订单
    List<Orders>  getOrderByUserID(@Param("userid")Integer userid);

    int paymentSuccess(@Param("code")String code);

    int cancleOrder();

    //查询多个
    List<Orders> selectOrders(@Param("page") Page page, @Param("text") String text);

    int getCount(@Param("text") String text);

    int putOn(@Param("orderid") int id);


    int end(@Param("orderid") int id);

    int get(@Param("orderid") int id);


    int deleteOrder(@Param("orderid") int orderid);

    Order_address getAddress(@Param("orderid") int id);


    List<Order_details> getDetails(@Param("orderid") int orderid);


}
